package reflect;
/**
 * JDK5之后java提供了一个特性: 变长参数
 */
public class ArgsDemo {
    public static void main(String[] args) {
        //变长参数只能是方法的最后一个参数
        //变长参数时编译器认可的, 最终编译后会变成数组
        doSome(1,"oen");
        doSome(1,"oen","two");
        doSome(1,"oen","two","three");
        doSome(1,"oen","two","three","four");
        doSome(1,"oen","two","three","four","five");
    }

    //public static void doSome(int a,String s){//创建一个两参的方法
    public static void doSome(int a,String...args){//创建一个两参, int加数组String变长参的方法
        System.out.println(args.length);
    }
}
